Passer au contenu principal
POST
/
toptimize
/
v1
/
rank
[Beta] Rank objects
curl --request POST \
  --url https://api.topsort.com/toptimize/v1/rank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ranking": [
    {
      "type": "listings",
      "slots": 3,
      "pageSize": 3,
      "page": {
        "type": "category",
        "value": "sneakers",
        "pageId": "/category/sneakers"
      },
      "opaqueUserId": "u_9ske45"
    }
  ]
}
'
{
  "results": [
    {
      "resultType": "listings",
      "results": [],
      "error": false
    }
  ]
}

Autorisations

Authorization
string
header
requis

A valid API key generated in Topsort's UI.

Corps

application/json

The context information to get the ranking, to rank organic and sponsored products.

ranking
object[]
requis
Required array length: 1 - 5 elements
Exemple:
[
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"page": {
"type": "category",
"value": "sneakers",
"pageId": "/category/sneakers"
},
"opaqueUserId": "u_9ske45"
}
]

Réponse

The ranking results. The list of winners will contain at most slots entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.

results
object[]
requis
Required array length: 1 - 5 elements
Exemple:
[
{
"resultType": "listings",
"results": [],
"error": false
}
]